<!DOCTYPE HTML>
<html  lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
	<form class="form-horizontal m" id="form-paperdef-add" autocomplete="off">
			<div class="form-group">
			<label class="col-sm-3 control-label">问卷名称：</label>
			<div class="col-sm-8">
				<input id="name" name="name" class="form-control" type="text">
			</div>
		</div>
	<div class="form-group">
			<label class="col-sm-3 control-label">问卷目的：</label>
			<div class="col-sm-8">
				<textarea id="intro" name="intro" class="form-control" rows="3"></textarea>
			</div>
		</div>
			<div class="form-group">
			<label class="col-sm-3 control-label">问卷来源：</label>
			<div class="col-sm-8">
				<select id="kmid"  name="kmid" class="form-control noselect2 selectpicker">
                	<option value=""> -- 请选择问卷 -- </option>
                	<option th:each="km : ${kms}" th:value="${km.id}" th:text="${km.name}"></option>
                </select>
			</div>
		</div>
	
			<div class="form-group">
			<label class="col-sm-3 control-label">试卷状态：off关闭,默认on开放</label>
			<div class="col-sm-8">
				<div class="onoffswitch">
					<input type="checkbox" checked class="onoffswitch-checkbox" id="status" name="status">
					<label class="onoffswitch-label" for="status">
						<span class="onoffswitch-switch"></span>
						<span class="onoffswitch-inner"></span>
					</label>
				</div>
			</div>
		</div>
	
			<div class="form-group">
			<label class="col-sm-3 control-label">开始时间：</label>
			<div class="col-sm-8">
				<input id="starttime" name="starttime" class="form-control time-input" datetype="datetime" type="text">
			</div>
		</div>
	
			<div class="form-group">
			<label class="col-sm-3 control-label">结束时间：</label>
			<div class="col-sm-8">
				<input id="endtime" name="endtime" class="form-control time-input" datetype="datetime" type="text">
			</div>
		</div>
	
			<div class="form-group">
			<label class="col-sm-3 control-label">问卷时长：</label>
			<div class="col-sm-8">
				<input id="duration" name="duration" class="form-control" type="text">
			</div>
		</div>
	
			<div class="form-group">
			<label class="col-sm-3 control-label">禁止交卷时长：</label>
			<div class="col-sm-8">
				<input id="nojj" name="nojj" class="form-control" type="text">
			</div>
		</div>
	
	</form>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript">
	var prefix = ctx + "qn/paperdef"
	$("#form-paperdef-add").validate({
		onkeyup: false,
		rules:{
			name:{
				required:true
			},
			intro:{
				required:true
			},
			kmid:{
				required:true
			},
			starttime:{
				required:true
			},
			endtime:{
				required:true
			},
			duration:{
				required:true,
				digits:true
			}
		}
	});

	function submitHandler() {
		if ($.validate.form()) {
			$.operate.save(prefix + "/addDo", $('#form-paperdef-add').serialize());
		}
	}
</script>
</body>
</html>
